<script>
export default {
	onLaunch() {
		const updateManager = uni.getUpdateManager();
		updateManager.onCheckForUpdate(function (res) {
			if (res.hasUpdate) {
				updateManager.onUpdateReady(function () {
					uni.showModal({
						title: '更新提示',
						content: '新版本已经准备好，是否重启应用？',
						success(res) {
							if (res.confirm) {
								// 用户点击确定更新
								updateManager.applyUpdate();
							}
						}
					});
				});
				updateManager.onUpdateFailed(function () {
					vk.toast('更新失败', 'none');
				});
			}
		});
	}
};
</script>

<style lang="scss">
/* 引入全局SCSS变量 */
@import './uni.scss';

text {
	display: inline-block;
}
view {
	box-sizing: border-box;
}
page {
	height: 100vh;
	padding: 0;
	margin: 0;
	background-color: #f5f5f5;
	font-family: PingFangSC;
}

/* 全局主题色样式 */
.theme-color {
	color: $uni-theme-color;
}
.theme-bg {
	background-color: $uni-theme-color;
}
.theme-border {
	border-color: $uni-theme-color;
}

/* 覆盖Element UI的主题色 */
.el-button--primary {
	background-color: $uni-theme-color !important;
	border-color: $uni-theme-color !important;
}
.el-button--primary:hover, 
.el-button--primary:focus {
	background-color: rgba($uni-theme-color, 0.8) !important;
	border-color: rgba($uni-theme-color, 0.8) !important;
}

/* 覆盖uni-app按钮的主题色 */
.uv-button--primary {
	background-color: $uni-theme-color !important;
}
</style>
